<template>
<tree-selector 
  ref="deptTreeRef"
  v-bind="$props"
  tree-title="部门"
  />
</template>

<script setup>
import { ref } from 'vue'
import TreeSelector from '@/components/treeSelector/TreeSelector'

/* // 定义 props
const props = defineProps({
  treeData: {
    type: Array,
    default: () => []
  },
  // 添加 dataApi 属性，用于从后台获取数据
  dataApi: {
    type: String,
    default: ''
  },
  dataKey:{
    type: String,
    default: 'id'
  }
}) */

// 组件引用
const deptTreeRef = ref()
// 修改 selectDept 方法，在初始化时更新全选状态
const selectDept = (selectedIds = [], callback, limitCount = 0) => {
    deptTreeRef.value.selectTreeDialog(selectedIds, callback, limitCount)
}

// 暴露方法给父组件
defineExpose({
  selectDept
})
</script>